<?
$r = "";
require_once($r."_config/db.php");
require_once($r."_engine/functions.php");
require_once($r."_engine/c_sql_table.php");
require_once($r."_engine/c_resources_storage.php");

$res = execute_query('
SELECT 
	MAX(resources_storage.id) AS id,
	MAX(resources_storage.download_dt) AS dt,
	resources_storage.effective_url AS url
FROM resources_storage
LEFT JOIN monitors ON 
	resources_storage.monitor_id = monitors.id
WHERE
	monitors.disable_top_list_stats <> 1 AND
	(resource_status = '.RESOURCE_STORAGE_STATUS_CHANGED.' OR
     resource_status = '.RESOURCE_STORAGE_STATUS_TRIGGERED.')
GROUP BY
	resources_storage.effective_url
ORDER BY 
	id DESC,
	dt DESC
LIMIT 0, 10;
');


$i = 0;
while ($row = @mysql_fetch_array($res))
{
	if ($i != 0) echo " &bull; ";
	
	$time = delta_time_to_str(gmt_time() - strtotime($row["dt"]), $g_delta_format_FP);
	
	echo '<a href="'.normalize_url($row["url"]).'" target="_blank">'.domain_name_from_url($row["url"]).'</a> '.
		"<span class=smaller>".$time." ago</span>\n";

	$i++;
}
?>
